package cn.com.cfae.iras.doc.analyze.parse.model;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 资产负债表
 */
public class ZCFZModel extends BizBaseModel {

    /**
     * 资产负债表业务模型
     */
    public static String MODEL_NAME = "ZCFZ";

    /**
     * 资产总计
     */
    private static String ZCZJ = "ZCZJ";

    /**
     * 应收票据及应收账款
     */
    private static String YSPJJYSZK = "YSPJJYSZK";
    /**
     * 应收账款
     */
    private static String YSZK = "YSZK";

    /**
     * 应收票据
     */
    private static String YSPJ = "YSPJ";

    /**
     * 应付票据
     */

    private static String YFPJ = "YFPJ";

    /**
     * 应付账款
     */
    private static String YFZK = "YFZK";



    /**
     * 存货
     */
    private static String CH = "CH";

    /**
     * 货币资金
     */
    private static String HBZJ = "HBZJ";

    /**
     * 预付款项
     */
    private static String YFKX = "YFKX";

    /**
     * 其他应收款
     */
    private static String QTYSK = "QTYSK";


    /**
     * 持有待售资产
     */
    private static String CYDSZC = "CYDSZC";

    /**
     * 其他流动资产
     */
    private static String QTLDZC = "QTLDZC";

    /**
     * 一年内到期的非流动负债
     */
    private static String YNNDQFLDZC = "YNNDQFLDZC";
    /**
     * 流动资产合计
     */
    private static String LDZCHJ = "LDZCHJ";
    /**
     * 可供出售金融资产
     */
    private static String KGCSJRZC = "KGCSJRZC";
    /**
     * 持有至到期投资
     */
    private static String CYZDQTZ = "CYZDQTZ";
    /**
     * 长期应收款
     */
    private static String CQYSK = "CQYSK";
    /**
     * 长期股权投资
     */
    private static String CQGQTZ = "CQGQTZ";
    /**
     * 投资性房地产
     */
    private static String TZXFDC = "TZXFDC";
    /**
     * 固定资产
     */
    private static String GDZC = "GDZC";
    /**
     * 在建工程
     */
    private static String ZJGC = "ZJGC";
    /**
     * 无形资产
     */
    private static String WXZC = "WXZC";


    /**
     * 开发支出
     */
    private static String KFZC = "KFZC";

    /**
     * 商誉
     */
    private static String SY = "SY";

    /**
     * 长期待摊费用
     */
    private static String CQDTFY = "CQDTFY";

    /**
     * 递延所得税资产
     */
    private static String DYSDSZC = "DYSDSZC";

    /**
     * 其他非流动资产
     */
    private static String QTFLDZC = "QTFLDZC";

    /**
     * 非流动资产合计
     */
    private static String FLDZCHJ = "FLDZCHJ";

    ////////////////////////////////////////////负债

    /**
     * 短期借款
     */
    private static String DQJK = "DQJK";
    /**
     * 衍生金融负债
     */
    private static String YSJRZC = "YSJRZC";
    /**
     * 应付票据及应付账款
     */
    private static String YFPJJYFZK = "YFPJJYFZK";


    /**
     * 预收款项
     */
    private static String YSKX = "YSKX";
    /**
     * 应付职工薪酬
     */
    private static String YFZGXC = "YFZGXC";
    /**
     * 应交税费
     */
    private static String YJSF = "YJSF";
    /**
     * 其他应付款
     */
    private static String QTYFK = "QTYFK";
    /**
     * 持有待售负债
     */
    private static String CYDSFZ = "CYDSFZ";
    /**
     * 一年内到期的非流动负债
     */
    private static String YNNDQFLDFZ = "YNNDQFLDFZ";
    /**
     * 其他流动负债
     */
    private static String QTLDFZ = "QTLDFZ";
    /**
     * 流动负债合计
     */
    private static String LDFZHJ = "LDFZHJ";
    /**
     * 长期借款
     */
    private static String CQJK = "CQJK";
    /**
     * 应付债券
     */
    private static String YFZQ = "YFZQ";
    /**
     * 优先股
     */
    private static String YXG = "YXG";
    /**
     * 永续债
     */
    private static String YXZ = "YXZ";
    /**
     * 长期应付款
     */
    private static String CQYFK = "CQYFK";
    /**
     * 预计负债
     */
    private static String YJFZ = "YJFZ";


    /**
     * 递延收益
     */
    private static String DYSY = "DYSY";

    /**
     * 递延所得税负债
     */
    private static String DYSDSFZ = "DYSDSFZ";

    /**
     * 其他非流动负债
     */
    private static String QTFLDFZ = "QTFLDFZ";

    /**
     * 非流动负债合计
     */
    private static String FLDFZHJ = "FLDFZHJ";
    /**
     * 负债合计
     */
    private static String FZHJ = "FZHJ";
    /**
     * 所有者权益或股东权益
     */
    private static String SYZQY = "SYZQY";

    /**
     * 实收资本或股本
     */
    private static String SSZB = "SSZB";
    /**
     * 其他权益工具
     */
    private static String QTQYGJ = "QTQYGJ";
//
//    /**
//     * 优先股
//     */
//    private static String YXG = "CH";
//
//    /**
//     * 永续债
//     */
//    private static String WXZC = "CH";

    /**
     * 资本公积
     */
    private static String ZBGJ = "ZBGJ";

    /**
     * 减：库存股
     */
    private static String KCG = "KCG";

    /**
     * 其他综合收益
     */
    private static String QTZHSY = "QTZHSY";

    /**
     * 盈余公积
     */
    private static String YYGJ = "YYGJ";


    /**
     * 未分配利润
     */
    private static String WFPLR = "WFPLR";

    /**
     * 应付短期债券
     */
    private static String YFDQZQ = "YFDQZQ";

    /**
     * 应付长期债券
     */
    private static String YFCQZQ = "YFCQZQ";


    /**
     * 负债和所有者权益（或股东权益）总计
     */
    private static String FZHSYZQYZJ = "FZHSYZQYZJ";

    /**
     * 所有者权益合计
     */
    private static String SYZQYHJ = "SYZQYHJ";
    /**
     * 归属于母公司所有者权益合计
     */
    private static String GSYMGSSYZQYHJ = "GSYMGSSYZQYHJ";

    private static Map<String, String> items = new HashMap<>();

    static {
        items.put(ZCZJ, "资产总计|总资产|资产合计|资产总值|资产总额");
        items.put(YSPJJYSZK, "应收票据及应收账款");
        items.put(YSZK, "应收账款");
        items.put(YSPJ, "应收票据");
        items.put(CH, "存货");
        items.put(HBZJ, "货币资金");
        items.put(YFKX, "预付款项");
        items.put(QTYSK, "其他应收款");
        items.put(CYDSZC, "持有待售资产");
        items.put(QTLDZC, "其他流动资产");
        items.put(YNNDQFLDZC, "一年内到期的非流动资产");
        items.put(LDZCHJ, "流动资产合计");
        items.put(KGCSJRZC, "可供出售金融资产");
        items.put(CYZDQTZ, "持有至到期投资");
        items.put(CQYSK, "长期应收款");
        items.put(CQGQTZ, "长期股权投资");
        items.put(TZXFDC, "投资性房地产");
        items.put(GDZC, "固定资产");
        items.put(ZJGC, "在建工程");
        items.put(WXZC, "无形资产");
        items.put(KFZC, "开发支出");
        items.put(SY, "商誉");
        items.put(CQDTFY, "长期待摊费用");
        items.put(DYSDSZC, "递延所得税资产");
        items.put(QTFLDZC, "其他非流动资产");
        items.put(FLDZCHJ, "非流动资产合计");
        items.put(DQJK, "短期借款");
        items.put(YSJRZC, "衍生金融负债");
        items.put(YFPJJYFZK, "应付票据及应付账款");
        items.put(YFZK, "应付账款");
        items.put(YFPJ, "应付票据");
        items.put(YSKX, "预收款项");
        items.put(YFZGXC, "应付职工薪酬");
        items.put(YJSF, "应交税费");
        items.put(QTYFK, "其他应付款");
        items.put(CYDSFZ, "持有待售负债");
        items.put(YNNDQFLDFZ, "一年内到期的非流动负债");
        items.put(QTLDFZ, "其他流动负债");
        items.put(LDFZHJ, "流动负债合计");
        items.put(CQJK, "长期借款");
        items.put(YFZQ, "应付债券");
        items.put(YXG, "优先股");
        items.put(YXZ, "永续债");
        items.put(CQYFK, "长期应付款");
        items.put(YJFZ, "预计负债");
        items.put(DYSY, "递延收益");
        items.put(DYSDSFZ, "递延所得税负债");
        items.put(QTFLDFZ, "其他非流动负债");
        items.put(FLDFZHJ, "非流动负债合计");
        items.put(FZHJ, "负债合计");
        items.put(SYZQY, "负债所有者权益或股东权益合计");
        items.put(SSZB, "实收资本或股本|实收资本");
        items.put(QTQYGJ, "其他权益工具");
        items.put(ZBGJ, "资本公积");
        items.put(KCG, "减：库存股");
        items.put(QTZHSY, "其他综合收益");
        items.put(YYGJ, "盈余公积");
        items.put(WFPLR, "未分配利润");
        items.put(FZHSYZQYZJ, "负债和所有者权益（或股东权益）总计|负债和所有者权益总计|负债和所有者权益合计|负债和股东权益总计|负债及股东权益总计");
        items.put(YFDQZQ, "应付短期债券");
        items.put(YFCQZQ, "应付长期债券");
        items.put(SYZQYHJ, "权益总值|所有者权益合计|所有者权益总计|所有者权益(或股东权益)合计|股东权益合计|所有者权益(或股东权益合计)");
        items.put(GSYMGSSYZQYHJ, "归属于母公司所有者权益合计|归属于母公司股东权益合计");
    }

    public static List<ExtractItem> createExtractItemList() {
        List<ExtractItem> extractItemList = new ArrayList<>();
        items.forEach((key, value) -> {
            ExtractItem extractItem = new ExtractItem();
            extractItem.setItemName(key);
            extractItem.setSynonyms(value.split(SYNONYM_SPLIT_CHAR));
            extractItemList.add(extractItem);
        });
        return extractItemList;
    }

}
